local qicai = fk.CreateSkill{
  name = "mini_ex__qicai",
  tags = { Skill.Compulsory },
}

Fk:loadTranslationTable{
  ["mini_ex__qicai"] = "奇才",
  [":mini_ex__qicai"] = "锁定技，你使用锦囊牌无距离限制。你于你的回合内使用的第一张锦囊牌不能被响应。",

  ["$mini_ex__qicai1"] = "妾所长无他，唯善以奇制胜。",
  ["$mini_ex__qicai2"] = "兽奇于行，人奇于思。",
}

qicai:addEffect(fk.CardUsing, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    if target == player and player:hasSkill(qicai.name) and
      data.card.type == Card.TypeTrick and player.room:getCurrent() == player then
      local use_events = player.room.logic:getEventsOfScope(GameEvent.UseCard, 1, function (e)
        local use = e.data
        return use.from == player and use.card.type == Card.TypeTrick
      end, Player.HistoryTurn)
      return #use_events > 0 and use_events[1].data == data
    end
  end,
  on_use = function (self, event, target, player, data)
    data.disresponsiveList = table.simpleClone(player.room.players)
  end,
})

qicai:addEffect("targetmod", {
  bypass_distances = function(self, player, skill, card)
    return player:hasSkill(qicai.name) and card and card.type == Card.TypeTrick
  end,
})

return qicai
